package sy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * SysProjectOwnerMapping entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_user_unit_mapping", catalog = "ssh")
public class SysUserUnitMapping implements java.io.Serializable {

	// Fields

	private String id;
	private SysUser sysUser;
	private SysUnit sysUnit;
	private String remarks;

	// Constructors

	/** default constructor */
	public SysUserUnitMapping() {
	}

	/** full constructor */
	public SysUserUnitMapping(String id, SysUser sysUser, SysUnit sysUnit,
			String remarks) {
		super();
		this.id = id;
		this.sysUser = sysUser;
		this.sysUnit = sysUnit;
		this.remarks = remarks;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.string")
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 64)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "sysUser")
	public SysUser getSysUser() {
		return sysUser;
	}

	public void setSysUser(SysUser sysUser) {
		this.sysUser = sysUser;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "sysUnit")
	public SysUnit getSysUnit() {
		return sysUnit;
	}

	public void setSysUnit(SysUnit sysUnit) {
		this.sysUnit = sysUnit;
	}
	
	@Column(name = "remarks")
	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

}